<template>
  <TestButton>Hello</TestButton>
  <div class="home">
    <h1>测试</h1>
    <h1>MarkDown编辑器用于编辑题目内容</h1>
    <MdEditor :value="mdValue" :handle-change="onMdChange" />
    <h1>代码编辑器</h1>
    <CodeEditor :value="codeValue" :handle-change="onCodeChange" />
    <button @click="show">测试提交</button>
  </div>
</template>

<script setup lang="ts">
import MdEditor from "@/components/MdEditor.vue";
import { ref } from "vue";
import CodeEditor from "@/components/CodeEditor.vue";
import TestButton from "@/components/testButton.vue";

const codeValue = ref("Hello World");
const onCodeChange = (v: string) => {
  codeValue.value = v;
  console.log(v);
};
const mdValue = ref("Hello World");
const onMdChange = (v: string) => {
  mdValue.value = v;
  console.log(v);
};

function show() {
  console.log(codeValue.value);
  console.log(mdValue.value);
}
</script>
